package edu.towson.cis.cosc490.cero1.lab3;

public enum Priority {
	// compares given priorities, returns 1 if a>b, otherwise b>a and return 0;

	// 3 priorities for ToDoItems
	HIGH("High", 3), MEDIUM("Medium", 2), LOW("Low", 1);
	// stores priority value
	private int value;
	private String name;

	// enum constructor
	private Priority(String n, int v) {
		this.setName(n);
		this.value = v;
	}

	public int compareTo(Priority a, Priority b) {
		int compare;
		if (a.value > b.value) {
			compare = 1;
		} else if (a.value == b.value) {
			compare = 0;
		} else {
			compare = -1;
		}
		return compare;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
